/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */
package cn.webrx.mp;

import cn.webrx.mapper.DbMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.session.SqlSession;
import org.junit.jupiter.api.Test;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;

import java.util.List;

/**
 * <p></p>
 * <p>Powered by webrx On 2023-04-25 09:23:25</p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
@SpringJUnitConfig(locations = "classpath:appconfig.xml") @Slf4j
public class DemoSpringXml {
    @Autowired
    ApplicationContext ctx;

    @Autowired
    DbMapper dm;

    @Autowired
    SqlSession ss;

    @Autowired
    MysqlDdl md;

    @Test
    void m2(){
        List<String> ds  = ss.selectList("dbs");
        log.info("{}",ds);
    }


    @Test
    void m1() throws Exception {
        //SqlSession ss = sf.getObject().openSession();
        //System.out.println(ss);
        System.out.println(dm.dbs());
        log.info("hello world {}",dm.dbs());

    }

    @Test
    void m(){
        for (String n : ctx.getBeanDefinitionNames()) {
            System.out.println(n);
        }
    }
}
